<?php
namespace app\common\validate;

use think\Validate;

class LinkDetailValidate extends Validate
{
    protected $rule =   [
        'title'  => 'require|max:25',
        'url' => 'require|url',
		'description' => 'require|max:200',
		'logo' => 'require',
		'sort'	=> 'require|number',
		'type'	=> 'require|number'
    ];
    
    protected $message  =   [
        'title.require' => '名称必须',
        'title.max'     => '名称最多不能超过25个字符',
        'url.require'=> '邮箱必须填写',
        'url.url'  => '必须是网址格式',
		'description.require'=> '描述必须填写',
		'description.max'  => '描述最多不能超过200个字符',
		'logo.require'=> '图片必须填写',
		'sort.require' => '必须输入排序',
		'sort.number' => '必须输入数字',
		'type.require' => '必须选择类别',
		'type.number' => '类别必须是数字'
    ];
    
    protected $scene = [
        'add'  =>  ['name','url','description','sort','type'],
        'edit'  =>  ['name','url','description','sort','type'],
		'sort' => ['sort']
    ];
}
